package com.ui.data {
	import com.net.AssetData;
	import com.ui.core.ScaleMode;
	import com.ui.core.UIComponentData;

	import flash.geom.Rectangle;
	import flash.text.TextFormatAlign;

	/**
	 * Game Tool Tip Data
	 * 
	 * @author Cafe
	 * @version 20100719
	 */
	public class ToolTipData extends UIComponentData
	{
		public var backgroundAsset : AssetData;
		public var labelData : LabelData = new LabelData();
		public var padding : int;
		public var alginMode : int;
		public var initNow : Boolean = true;
		public var source : *;
		public var underMouse : Boolean;
		override protected function parse( source : * ) : void
		{
			super.parse( source );
			var data : ToolTipData = source as ToolTipData;
			if (data == null) return;
			data.backgroundAsset = backgroundAsset;
			data.labelData = labelData;
			data.padding = padding;
			data.alginMode = alginMode;
			data.source = source;
			data.initNow = initNow;
		}

		public function ToolTipData()
		{
			var inner:Rectangle = new Rectangle( 10, 10, 25, 5 );
			var assetData:AssetData = new AssetData( "tip" );
			assetData.isScaleBitmap = true;
			assetData.inner = inner;
			backgroundAsset = assetData;
			padding = 5;
			alginMode = 0;
			scaleMode = ScaleMode.AUTO_SIZE;
			labelData.textFormat.align = TextFormatAlign.LEFT;
		}

		override public function clone() : *
		{
			var data : ToolTipData = new ToolTipData();
			parse( data );
			return data;
		}
	}
}